package Prototype_mode.Sale;

import java.util.Scanner;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class clinet {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        Customer customer,new_cus=null;
        customer=new Customer();
        Address address=new Address();
        customer.setAddress(address);
        System.out.println("深克隆选1，浅克隆选2");
        int a=scanner.nextInt();
        if(a==1){
            try{
                new_cus=customer.deepClone();
            }
            catch (Exception e){
                System.err.println("失败");
            }
            System.out.println("数据是否相同"+(customer==new_cus));
            System.out.println("地址是否相同"+(customer.getAddress()== new_cus.getAddress()));
        }
        else if(a==2){
            new_cus=customer.clone();
            System.out.println("数据是否相同"+(customer==new_cus));
            System.out.println("地址是否相同"+(customer.getAddress()== new_cus.getAddress()));

        }
        else {
            System.out.println("输入错误");
        }
    }
}
